package com.doculibre.constellio.connector.twitter;

import java.util.Iterator;
import java.util.List;

import com.google.enterprise.connector.spi.Document;
import com.google.enterprise.connector.spi.DocumentList;
import com.google.enterprise.connector.spi.RepositoryException;

/**
 * 
 * List of Tweet Documents
 * 
 * @author France Labs
 * 
 */
public class TwitterDocumentList implements DocumentList {
	  private Iterator<Document> iterator;
	  private Document document;
	  private String checkpoint;
	  
	  public TwitterDocumentList(List<Document> documents, String checkpoint) {
	    this.iterator = documents.iterator();
	    this.checkpoint = checkpoint;
	    this.document = null;
	  }
	  public Document nextDocument() {
	    if (iterator.hasNext()) {
	      document = iterator.next();
	      return document;
	    }
	    return null;
	  }
	  public String checkpoint() throws RepositoryException {
		  return checkpoint;
	  }
	  
	  public void setCheckpoint(String checkpoint){
		  this.checkpoint = checkpoint;
	  }
	
}
  
 